package com.mazaiting.fluterintenttest

import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button

class MainActivity : AppCompatActivity() {
  
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    
    val btnStart = this.findViewById<Button>(R.id.btn_start)
    btnStart.setOnClickListener {
      val intent = Intent()
      intent.action = Intent.ACTION_SEND
      intent.addCategory(Intent.CATEGORY_DEFAULT)
      intent.type = "text/plain"
      intent.putExtra(Intent.EXTRA_TEXT, "mazaiting")
      startActivity(intent)
    }
  }
}
